#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pwd.h>

int testCrypt() {
    char *setting;
    char buf[32];

    printf("set crypt setting: \n");
    setting = fgets(buf,32,stdin);
    printf("setting=%s\n",setting);

    while (1)
    {
        char * pwd = getpass("Input password: ");
        if(*pwd == '\0')
        {
            printf("Done! ");
            return 0;
        }
        printf("crypt result: %s\n", crypt(pwd, setting));
    }
    return 0;
}

